﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FetionWebMessenger.IWeatherWebService;
using System.Text;
using FetionWebMessenger.Util;
namespace FetionWebMessenger.AddWebService
{
    public class WeatherProvider
    {
        static FetionWebMessenger.IWeatherWebService.Service weather = new FetionWebMessenger.IWeatherWebService.Service();
        static public String GetWeather(string SateOrCode)
        {
            //FetionWebMessenger.IWeatherWebService.Service weather = new FetionWebMessenger.IWeatherWebService.Service();
            string[] str = weather.getWeatherbyCityName(SateOrCode, theDayFlagEnum.Tomorrow);
            //weather.get
            String tmp = str[1] + "明日天气:" + str[2] + ",温度:" + str[3] + ",风向:" + str[4];
            return tmp;
        }
        static public String GetSupportProvince()
        {
            String temp = "";
            String[] Provinces = weather.getSupportProvince();
            Boolean first = true;
            foreach (String Province in Provinces)
            {
                if (first)
                {
                    first = false;
                    continue;
                }
                temp += "&lt;option value='" + Province.Trim() + "'&gt;" + Province.Trim() + "&lt;/option&gt;";
            }
            return temp;
        }
        static public String GetSupportCity(string Province)
        {
            String temp = "";
            String[] Citys = weather.getSupportCity(Province);
            Boolean first = true;
            foreach (String City in Citys)
            {
                if (first)
                {
                    first = false;
                    continue;
                }
                temp += "&lt;option value='" + City.Trim() + "'&gt;" + City.Trim() + "&lt;/option&gt;";
            }
            return temp;
        }
    }
}
